/*
2021-7-11
https://www.acwing.com/problem/content/3762/
*/

#include<iostream>
#include<cstring>
#include<algorithm>

using namespace std;


int main()
{
    ios::sync_with_stdio(false);
    cout.tie(NULL);
    int T;
    cin>>T;
    while(T--)
    {
        int n,k;
        cin>>n>>k;
        for(int i=n-1;i;i--)
        {
            if(k > n-i) k-=n-i;
            else
            {
                string s(n,'a');
                s[i-1]=s[n-k]='b';
                cout<<s<<endl;
                break;
            }
        }
    }
    return 0;
}
